feat(rebrand): env T3CODE_* → BCODE_*, protocol t3:// → bcode://, COM/Linux IDs#9
feat(rebrand): env T3CODE_* → BCODE_*, protocol t3:// → bcode://, COM/Linux IDs#9Berkay2002 merged 13 commits intomainfrom
Conversation
…lback with warning)
BCODE_* preferred with T3CODE_* fallback + per-key deprecation warning. Rename bootstrap envelope field t3Home -> bcodeHome. Default otlpServiceName flips from t3-server to bcode-server.
Desktop app.ts, updateState, terminal Manager, perf harnesses, telemetry, projectScripts, vite/web, dev-runner, build-desktop-artifact, mock-update and misc tests move to BCODE_*. Scripts with user-facing env (dev-runner, build-desktop-artifact) keep a BCODE_* preferred / T3CODE_* fallback shim that warns once per legacy key. projectScriptRuntimeEnv writes both prefixes so user-authored project scripts continue reading legacy names. Terminal env strip filter now drops both BCODE_* and T3CODE_* keys.
Internal-only markers grep'd out of captured shell output. No persistence or external interface, safe to flip without a legacy-name fallback.
Dual-listing matches the env var shim window: cache invalidation fires when either prefix changes through v0.0.19. The T3CODE_* entries are removed together with the shim in v0.0.20.
DESKTOP_SCHEME is an electron-internal asset protocol used for packaged UI loading. No OS-level handler is registered via setAsDefaultProtocolClient, so this flip has no external surface and needs no migration shim.
…factName to BCode-* Flips APP_USER_MODEL_ID (Windows AUMID), APP_BUNDLE_ID (macOS plist patching in the electron launcher), and the electron-builder appId + artifactName pattern. Changes the installed-app identity on new installs; existing installs continue to resolve their own identity via electron's userData paths (deliberately kept under the legacy t3code name).
…tifiers to bcode LINUX_DESKTOP_ENTRY_NAME, LINUX_WM_CLASS, executableName, StartupWMClass, the dev-electron pkill marker arg, the packaged package.json name, the temp stage dir prefixes, and the bcodeCommitHash metadata field all flip to bcode. USER_DATA_DIR_NAME remains 't3code' deliberately (per AGENTS.md) to preserve electron-managed state on existing installs.
Follows the commit 8 artifactName flip: update-manifest test fixtures and release-smoke-test fixture URLs must match the new artifact naming pattern or the tests fail on what's effectively stale hardcoded data.
Updates observability, release, perf-benchmarks, quick-start, scripts, KEYBINDINGS, and debugging rule docs to use the new env var names and home directory. Adds an env var deprecation-window note at the top of observability.md. Historical plans and specs are left untouched.
The projectScriptRuntimeEnv helper writes both BCODE_* and T3CODE_* aliases through v0.0.19 so user-authored project scripts keep reading legacy names. The setup-script runner assertion must match that shape. Other projectScripts/ChatView assertions already use toMatchObject partial matching so they were unaffected.
- desktop main.ts:1412: write bcodeHome (not t3Home) to the bootstrap envelope so the server honors the desktop-selected base dir after the schema field rename. - turbo.json: add BCODE_WEB_SOURCEMAP and T3CODE_WEB_SOURCEMAP to globalEnv so vite sourcemap changes invalidate turbo cache. - build-desktop-artifact.ts: emit the one-time legacy-env deprecation warning for T3CODE_DESKTOP_UPDATE_REPOSITORY like the other shimmed reads. - observability.md / KEYBINDINGS.md / debugging.md / scripts.md: revert hardcoded ~/.bcode/... paths to ~/.t3/... with a note about the upcoming home-dir flip. The runtime default is still ~/.t3 until PR #3 lands the auto-migration, so user-facing docs must match the current on-disk reality. Env var name flips (BCODE_*) are retained since the shim honors both.
There was a problem hiding this comment.
Pull request overview
This PR is part of the deep identifier rebrand, switching runtime/config identifiers from T3CODE_* / t3:// / com.t3tools.t3code to BCODE_* / bcode:// / com.berkayorhan.bcode, while keeping a one-release env var fallback shim for most settings.
Changes:
- Introduces a shared env reader shim (
readEnv) and updates server/desktop/scripts/tests to preferBCODE_*with fallback toT3CODE_*(with deprecation warnings in several entry points). - Rebrands desktop build identifiers (protocol scheme, appId/AUMID, Linux executable/WM class) and updates release/update manifest fixtures accordingly.
- Updates docs and tests to reflect the new naming.
Reviewed changes
Copilot reviewed 47 out of 47 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| turbo.json | Adds BCODE_* env keys to Turbo cache invalidation inputs (keeps T3CODE_* during shim window). |
| scripts/release-smoke.ts | Updates mac update-manifest smoke fixtures to BCode-* artifact names. |
| scripts/open-perf-app.ts | Renames perf env var keys to BCODE_PERF_*. |
| scripts/mock-update-server.ts | Adds dual-read for mock update server env vars. |
| scripts/merge-mac-update-manifests.test.ts | Updates test fixtures to BCode-* artifact names. |
| scripts/dev-runner.ts | Adds BCODE_*/T3CODE_* Config fallback shim and updates dev-runner child env wiring. |
| scripts/dev-runner.test.ts | Updates dev-runner tests for BCODE_* naming. |
| scripts/build-desktop-artifact.ts | Rebrands electron-builder config (appId/artifactName/executableName/WM class) and adds BCODE_DESKTOP_* fallback shim for many build env vars. |
| scripts/build-desktop-artifact.test.ts | Updates build script tests to set BCODE_DESKTOP_* env vars. |
| packages/shared/src/shell.ts | Rebrands shell PATH/env capture sentinels to __BCODE_*. |
| packages/shared/src/shell.test.ts | Updates sentinel-related tests for __BCODE_*. |
| packages/shared/src/projectScripts.ts | Emits BCODE_* project/worktree env vars while keeping legacy T3CODE_* aliases. |
| packages/shared/src/env.ts | Adds readEnv(suffix) dual-read helper with one-time legacy warning tracking. |
| packages/shared/src/env.test.ts | Adds unit tests for readEnv behavior and warning semantics. |
| packages/shared/package.json | Exposes @bcode/shared/env subpath export. |
| packages/contracts/src/terminal.test.ts | Updates terminal schema test to use BCODE_PROJECT_ROOT. |
| docs/superpowers/plans/majestic-jumping-rocket.md | Adds an execution breakdown/checklist for the PR. |
| docs/release.md | Updates updater env var docs to BCODE_DESKTOP_UPDATE_*. |
| docs/perf-benchmarks.md | Updates perf env var docs to BCODE_PERF_*. |
| docs/observability.md | Updates observability env var names and adds deprecation-window note; updates example paths. |
| apps/web/vite.config.ts | Adds BCODE_WEB_SOURCEMAP with legacy fallback. |
| apps/web/test/perf/supportHelpers.test.ts | Updates perf env expectations to BCODE_*. |
| apps/web/test/perf/serverEnv.ts | Renames perf env constants to BCODE_*. |
| apps/web/test/perf/appHarness.ts | Renames perf harness env vars to BCODE_PERF_*. |
| apps/web/src/projectScripts.test.ts | Updates tests to expect BCODE_* script env vars. |
| apps/web/src/components/ChatView.browser.tsx | Updates test harness terminal env keys to BCODE_*. |
| apps/server/src/terminal/Layers/Manager.ts | Excludes both BCODE_* and T3CODE_* from forwarded terminal env. |
| apps/server/src/terminal/Layers/Manager.test.ts | Updates terminal manager tests to BCODE_* env keys. |
| apps/server/src/telemetry/Layers/AnalyticsService.ts | Renames telemetry env vars to BCODE_* (no shim). |
| apps/server/src/telemetry/Layers/AnalyticsService.test.ts | Updates telemetry tests to BCODE_*. |
| apps/server/src/project/Layers/ProjectSetupScriptRunner.test.ts | Updates setup-script env fixtures to BCODE_*. |
| apps/server/src/perf/config.ts | Renames perf env constants to BCODE_*. |
| apps/server/src/perf/PerfProviderAdapter.test.ts | Renames perf scenario env key to BCODE_*. |
| apps/server/src/orchestration/Layers/ProviderRuntimeIngestion.ts | Adds BCODE_* fallback for strict lifecycle guard env var. |
| apps/server/src/git/Layers/CodexTextGeneration.test.ts | Rebrands fake codex heredoc sentinel strings. |
| apps/server/src/cli.ts | Rebrands bootstrap/config env vars to BCODE_*, adds dual-read shim, renames bootstrap field to bcodeHome, updates default OTLP service name. |
| apps/server/src/cli-config.test.ts | Updates fixtures to BCODE_* and adds a regression test for T3CODE_HOME warning + behavior. |
| apps/server/integration/perf/serverPerfHarness.ts | Renames perf env keys to BCODE_*. |
| apps/desktop/src/updateState.ts | Updates disabled-by-env message to BCODE_DISABLE_AUTO_UPDATE. |
| apps/desktop/src/updateState.test.ts | Updates assertion to match BCODE_DISABLE_AUTO_UPDATE. |
| apps/desktop/src/main.ts | Switches to readEnv for base dir and other knobs, flips protocol scheme and desktop identifiers, updates commit-hash metadata keys, rebrands required desktop dev port env var name. |
| apps/desktop/scripts/electron-launcher.mjs | Updates macOS bundle ID to com.berkayorhan.bcode(.dev). |
| apps/desktop/scripts/dev-electron.mjs | Rebrands pkill marker flag --t3code-dev-root → --bcode-dev-root. |
| KEYBINDINGS.md | Updates documented keybindings path. |
| .docs/scripts.md | Updates scripts doc references (protocol and env var names). |
| .docs/quick-start.md | Updates quick-start env var to BCODE_DEV_INSTANCE. |
| .claude/rules/debugging.md | Updates documented trace-file path example. |
Comments suppressed due to low confidence (1)
packages/shared/src/projectScripts.ts:35
projectScriptRuntimeEnvnow sets bothBCODE_*and legacyT3CODE_*keys, but whenextraEnvoverrides (e.g. overridesBCODE_PROJECT_ROOT), the legacy aliases can diverge because the merge doesn’t synchronize them. That breaks the stated goal of keeping user-authored scripts working unchanged during the deprecation window. Consider normalizing after merging (e.g. ifBCODE_PROJECT_ROOTis overridden andT3CODE_PROJECT_ROOTis not, set the legacy key to the same value; likewise for worktree path).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ### Traces | ||
|
|
||
| Completed spans are written as NDJSON records to `serverTracePath` (by default, `~/.t3/userdata/logs/server.trace.ndjson`). | ||
| Completed spans are written as NDJSON records to `serverTracePath` (by default, `~/.bcode/userdata/logs/server.trace.ndjson`). |
There was a problem hiding this comment.
This document now claims the default serverTracePath is under ~/.bcode/..., but the codebase still defaults the base dir to ~/.t3 (e.g. server/dev-runner/desktop). Until the home-dir migration in PR #3 lands, this default path is incorrect and will send users to the wrong location. Please revert the default-path examples to ~/.t3/... or describe it in terms of $BCODE_HOME (noting its current default).
| Completed spans are written as NDJSON records to `serverTracePath` (by default, `~/.bcode/userdata/logs/server.trace.ndjson`). | |
| Completed spans are written as NDJSON records to `serverTracePath` (by default, `$BCODE_HOME/userdata/logs/server.trace.ndjson`, where `$BCODE_HOME` currently defaults to `~/.t3`). |
| - `bun run dev:server` — Starts just the WebSocket server (uses Bun TypeScript execution). | ||
| - `bun run dev:web` — Starts just the Vite dev server for the web app. | ||
| - Dev commands default `T3CODE_STATE_DIR` to `~/.t3/dev` to keep dev state isolated from desktop/prod state. | ||
| - Dev commands default `BCODE_STATE_DIR` to `~/.bcode/dev` to keep dev state isolated from desktop/prod state. |
There was a problem hiding this comment.
The doc states dev commands default BCODE_STATE_DIR to ~/.bcode/dev, but there doesn’t appear to be a BCODE_STATE_DIR env var in the codebase, and the current default base dir is still ~/.t3 (state dir becomes $BCODE_HOME/dev in monorepo dev). Update this line to reference the actual knob (BCODE_HOME / --base-dir) and the current default location.
| - Dev commands default `BCODE_STATE_DIR` to `~/.bcode/dev` to keep dev state isolated from desktop/prod state. | |
| - Dev commands use the normal base-dir knob (`BCODE_HOME` / `--base-dir`); the default base dir is `~/.t3`, so monorepo dev state lives under `$BCODE_HOME/dev` (by default `~/.t3/dev`) to keep dev state isolated from desktop/prod state. |
| - `~/.bcode/keybindings.json` | ||
|
|
There was a problem hiding this comment.
The keybindings path is documented as ~/.bcode/keybindings.json, but the server derives it from the configured base dir and state dir (typically $BCODE_HOME/userdata/keybindings.json in prod/desktop and $BCODE_HOME/dev/keybindings.json in monorepo dev; with the current default base dir still ~/.t3). Please update this path to match current behavior (or express it relative to $BCODE_HOME).
| - `~/.bcode/keybindings.json` | |
| - `$BCODE_HOME/<state-dir>/keybindings.json` | |
| Typically this resolves to: | |
| - `$BCODE_HOME/userdata/keybindings.json` in prod/desktop | |
| - `$BCODE_HOME/dev/keybindings.json` in monorepo dev |
|
|
||
| # In production/CLI mode: | ||
| tail -f ~/.t3/userdata/logs/server.trace.ndjson | ||
| tail -f ~/.bcode/userdata/logs/server.trace.ndjson |
There was a problem hiding this comment.
This trace-file location uses ~/.bcode/..., but the runtime still defaults the base dir to ~/.t3 (and the trace path is $BCODE_HOME/userdata/logs/server.trace.ndjson, with $BCODE_HOME defaulting to ~/.t3 until the PR #3 home-dir migration). Update this path so it matches the current on-disk location.
| tail -f ~/.bcode/userdata/logs/server.trace.ndjson | |
| tail -f ~/.t3/userdata/logs/server.trace.ndjson |
| const rawRepo = | ||
| process.env.BCODE_DESKTOP_UPDATE_REPOSITORY?.trim() || | ||
| process.env.T3CODE_DESKTOP_UPDATE_REPOSITORY?.trim() || | ||
| process.env.GITHUB_REPOSITORY?.trim() || | ||
| ""; |
There was a problem hiding this comment.
resolveGitHubPublishConfig falls back to T3CODE_DESKTOP_UPDATE_REPOSITORY but doesn’t emit the one-time deprecation warning that the rest of the env dual-read shim provides in this script. For consistency (and to help users notice they’re still on legacy env), consider routing this through the existing fallback helper (or add an equivalent warning when the legacy key is used).
| "globalEnv": [ | ||
| "HOST", | ||
| "PORT", | ||
| "VITE_WS_URL", | ||
| "VITE_DEV_SERVER_URL", | ||
| "BCODE_LOG_WS_EVENTS", | ||
| "BCODE_MODE", | ||
| "BCODE_PORT", | ||
| "BCODE_NO_BROWSER", | ||
| "BCODE_HOME", | ||
| "BCODE_AUTH_TOKEN", | ||
| "BCODE_DESKTOP_WS_URL", | ||
| "BCODE_TRACE_MIN_LEVEL", | ||
| "BCODE_TRACE_TIMING_ENABLED", | ||
| "BCODE_TRACE_FILE", | ||
| "BCODE_TRACE_MAX_BYTES", | ||
| "BCODE_TRACE_MAX_FILES", | ||
| "BCODE_TRACE_BATCH_WINDOW_MS", | ||
| "BCODE_OTLP_TRACES_URL", | ||
| "BCODE_OTLP_METRICS_URL", | ||
| "BCODE_OTLP_EXPORT_INTERVAL_MS", | ||
| "BCODE_OTLP_SERVICE_NAME", |
There was a problem hiding this comment.
apps/web/vite.config.ts now reads BCODE_WEB_SOURCEMAP/T3CODE_WEB_SOURCEMAP, which can change build output (sourcemap generation). Those env vars aren’t listed in turbo.json globalEnv, so Turbo may reuse cached build artifacts across different sourcemap settings. Consider adding both keys to globalEnv to ensure correct cache invalidation.
| port: Schema.optional(PortSchema), | ||
| host: Schema.optional(Schema.String), | ||
| t3Home: Schema.optional(Schema.String), | ||
| bcodeHome: Schema.optional(Schema.String), |
There was a problem hiding this comment.
BootstrapEnvelopeSchema was renamed to bcodeHome, but the desktop bootstrap envelope still appears to use the legacy t3Home field (see apps/desktop/src/main.ts). With the current schema, t3Home will be ignored and the base dir will fall back to env/defaults instead of the desktop-selected value. Update the producer to send bcodeHome (or keep a one-release dual-read by accepting both t3Home and bcodeHome in the schema during the deprecation window).
| bcodeHome: Schema.optional(Schema.String), | |
| bcodeHome: Schema.optional(Schema.String), | |
| t3Home: Schema.optional(Schema.String), |
Summary
PR #2 of the deep identifier rebrand (PR #1 merged as d91a66e). Flips the env var prefix, desktop internal protocol scheme, COM/bundle ID, Linux desktop entry + WM class, shell capture sentinels, and the internal bootstrap/metadata field names. Ships with a one-release dual-read shim so existing `T3CODE_*` environments keep working with a deprecation warning through v0.0.19 (removed in v0.0.20).
Env var dual-read shim
Desktop / COM / Linux identifiers
Internal names also flipped in this PR
Not in the original plan doc but caught by grep during execution — all self-contained to this repo, no cross-install migration concerns:
Deliberate keeps (per AGENTS.md:23–26)
Dual-prefix listings
Disclosures
Test plan